//最简单的词云图
var myChart1 = echarts.init(document.getElementById("t1"));
var option1 = {
    series: [{
        //设置之前要把wordCloud库文件导入
        type:"wordCloud",
        data:[
         {name:'赵',value:100,},
         {name:'钱',value:90,},
         {name:'孙',value:80,},
         {name:'李',value:70,},
         {name:'周',value:85,},
         {name:'吴',value:75,},
         {name:'郑',value:80,},
         {name:'王',value:90,},
        ],
    }],      
};
myChart1.setOption(option1);
//最简单的词云图
words = [];
for(var i=100;i>0;i--){
    words.push({
        name:String(i),
        value:i,
    });
}
var myChart2 = echarts.init(document.getElementById("t2"));
var option2 = {
    title: {
        text: '词云',
        left: 'center',
    },
    series: [{
        //设置之前要把wordCloud库文件导入
        type:"wordCloud",
        //符号大小
        sizeRange:[1,30],
        //旋转角度
        rotationRange:[-180,180],
        //心型
        // shape:'cardioid',
        shape:'triangle',
        data:words,
    }],      
};
myChart2.setOption(option2);
//------------------
//最简单的词云图
var myChart3 = echarts.init(document.getElementById("t3"));
var option3 = {
    title: {
        text: '调色',
        left: 'center',
    },
    series: [{
        //设置之前要把wordCloud库文件导入
        type:"wordCloud",
        //符号大小
        sizeRange:[1,30],
        //旋转角度
        rotationRange:[-180,180],
        //圆形
        width: '200px',
        height: '200px',
        shape:'circle',
        data:words,
        textStyle:{
            color:function(){
                value1 =String(Math.round(Math.random() * 255));
                value2 =String(Math.round(Math.random() * 255));
                value3 =String(Math.round(Math.random() * 255));
                return 'rgb('+value1+","+value2+","+value3+')';
            }
        },
    }],      
};
myChart3.setOption(option3);
//----------------------------------------
var maskImg = new Image();
//图片转base64格式
//https://tool.jisuapi.com/pic2base64.html
maskImg.src = "";
// maskImg.src = "logo.png"
var myChart4 = echarts.init(document.getElementById("t4"));
var option4 = {
    title: {
        text: '换词云背景图',
    },
    series: [{
        //设置之前要把wordCloud库文件导入
        type:"wordCloud",
        //符号大小
        sizeRange:[1,30],
        //旋转角度
        rotationRange:[-180,180],
        maskImage:maskImg,
        data:words,

    }],      
};
myChart4.setOption(option4);